package com.neuedu.corejava.ch3.homework;
import java.util.Scanner;

//输入三个整数x,y,z，请把这三个数由小到大输出（知识点：条件语句）
public class test8 {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int x = 0, y = 0, z = 0;
		System.out.print("输入第一个数字：");
		    x = sc.nextInt();
		System.out.print("输入第二个数字：");
		    y = sc.nextInt();
		System.out.print("输入第三个数字：");
		    z = sc.nextInt();
		if (x > y) {
			int t = x;
			x = y;
			y = t;
		}
		if (x > z) {
			int t = x;
			x = z;
			z = t;
		}
		if (y > z) {
			int t = y;
			y = z;
			z = t;
		}
		System.out.println("三个数字由小到大排列为： " + x + " " + y + " " + z);
		System.out.println("三个数字由大到小排列为： " + z + " " + y + " " + x);

	}

}
